#include <QtGui/QApplication>
#include <QBitmap>

#include "MainWindow.h"
#include "LSStyle.h"
#include "Splash.h"

#ifdef NDEBUG
int APIENTRY WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int nCmdShow)
#else
int main(int argc, char *argv[])
#endif
{
#ifdef NDEBUG
	int argc;
	char *argv[4096];
	char *token;
	char *next_token;

	argc = 0;
	token = strtok_s(lpCmdLine, " ", &next_token);
	while (token)
	{
		argv[ argc ++ ] = token;
		token = strtok_s(NULL, " ", &next_token);
	}
#endif
	QApplication app(argc, argv);
    app.setStyle(new LSStyle());
    MainWindow *mainWin;
    Splash splash;
    splash.show();
    splash.activateWindow();
    splash.raise();
    splash.setLoadStep(0);
    splash.setLoadStep(1);
    splash.setLoadStep(2);
    mainWin = new MainWindow(splash);
    splash.setLoadStep(10);
    app.setStyleSheet(mainWin->styleSheet());
    mainWin->setStyleSheet("");
    mainWin->showMaximized();
    splash.hide();
    mainWin->activateWindow();
    mainWin->raise();
    int res = app.exec();
    delete mainWin;
    return res;
}
